package com.example.apisimpledy.entity.vo;

import com.example.apisimpledy.entity.dto.Comment;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.sql.Timestamp;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class CommentVO {

    private Long id;
    private String content;
    private Timestamp createdAt;

    public static CommentVO fromEntity(Comment comment) {
        return new CommentVO()
                .setId(comment.getId())
                .setContent(comment.getContent())
                .setCreatedAt(comment.getCreatedAt());
    }
}
